<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Home extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

    public function index() {
        $this->load->model("guest_model");
        
        $data	= array();
        
        $param			= array('page' => 'home');
        $data['berita'] = $this->guest_model->getBeritaByPage($param);
        
        if($data['berita'] == FALSE) {
        	$data['berita']['judul']	= 'Data Not Found';
        	$data['berita']['isi']		= 'Please Add Home News';
        }
        
        $param				= array('page' => 'news');
        $data['sidenews']	= $this->guest_model->getBeritaByPage($param, 1);
        
        $data['template']['topbanner']	= true;
        
        $this->load->view('essential/template', $data);
    }

}